ScxV6Server.AcceptAlarmByCookie Method

Accepts an alarm by its cookie.

Parameters

Returns

Returns a code, which describes the outcome of the alarm accept operation:

Code Description
AlarmAcceptedOK The alarm was accepted successfully.
AlarmAlreadyAccepted The alarm was already accepted.
AlarmIDInvalid The alarm was not found.
NotEnoughPriv You don't have sufficient privileges to accept the alarm.
AlarmNotExist The alarm does not exist.

Remarks

All alarms on the system have a unique numeric identifier called a cookie. Use this method to accept an alarm by its cookie.

Example:

The following example written in VB.NET asks the user for an alarm cookie of an alarm to accept along with an optional comment and attempts to accept the alarm.

Dim Svr As ScxV6DbClient.ScxV6Server

' Connect to the server

Svr = New ScxV6DbClient.ScxV6Server

Svr.Connect("MAIN", "", "")

' Attempt to accept an alarm by cookie ID

Console.Write("Enter the cookie ID to accept: ")

Dim Entry As String

Entry = Console.ReadLine()

Dim Cookie As Integer

Cookie = Integer.Parse(Entry)

Console.Write("Enter an acceptance comment, if required: ")

Dim AccComment As String

AccComment = Console.ReadLine()

Dim Result As ScxV6DbClient.ScxAcceptResult

Result = Svr.AcceptAlarmByCookie(Cookie, AccComment)

If Result = ScxV6DbClient.ScxAcceptResult.AlarmAcceptedOK Then

Console.WriteLine("Alarm accepted successfully.")

ElseIf Result = ScxV6DbClient.ScxAcceptResult.AlarmAlreadyAccepted Then

Console.WriteLine("This alarm is already accepted.")

ElseIf Result = ScxV6DbClient.ScxAcceptResult.AlarmIDInvalid Then

Console.WriteLine("Alarm ID invalid.")

ElseIf Result = ScxV6DbClient.ScxAcceptResult.AlarmNotExist Then

Console.WriteLine("No alarm exists with this cookie.")

ElseIf Result = ScxV6DbClient.ScxAcceptResult.NotEnoughPriv Then

Console.WriteLine("You do not have sufficient privileges to accept this alarm.")

ElseIf Result = ScxV6DbClient.ScxAcceptResult.UndefinedAcceptError Then

Console.WriteLine("Unknown error encountered.")

End If


Disclaimer

Geo SCADA Expert 2020